package Java攻略._1_基础知识._1_lambda表达式;

import java.io.File;
import java.io.FilenameFilter;
import java.util.Arrays;

/**
 *
 * 可参考：https://blog.csdn.net/Done_FollowMyHeart/article/details/81485744
 */
public class _4_FilenameFilter的匿名内部类实现 {

    public static void main(String[] args) {

        File fileDirectory = new File("src\\main\\java\\_1_MQ\\Kafka");

        String[] names = fileDirectory.list(new FilenameFilter() {
            @Override
            public boolean accept(File dir, String name) {
                return name.endsWith(".java");
            }
        });

        for (String str : names
             ) {
            System.out.println(str);
        }
    }
}
